<template>
  <div class="">
    <Helloworld :msg="data.msg" @handler="handler" />
    <h1>{{ num }}</h1>
    <h2>{{ data.msg }}</h2>
  </div>
</template>

<script setup>
import Helloworld from "../components/HelloWorld.vue";
import { ref, reactive } from "vue";
const num = ref(0);
const data = reactive({
  msg: "hello world",
});

const handler = (val) => {
  console.log("这是父组件的方法 接收子组件的数据" + val);
};

// setup语法糖 子组件只需要引入不需要注册
</script>

<style lang="scss"></style>
